<template>
  <el-container class="layout-container-demo" style="height: 100vh">
    <el-aside width="200px">
      <el-scrollbar>
        <el-menu :default-openeds="['1', '2', '3', '4', '5']">
          <el-sub-menu index="1">
            <template #title>
              <el-icon>
                <message />
              </el-icon>店铺
            </template>
            <el-menu-item-group>
              <el-menu-item index="1-1"><router-link to="/SellerOperate/Shop">我的店铺</router-link></el-menu-item>
              <el-menu-item index="1-2"><router-link to="/ShopCreate">注册新店铺</router-link></el-menu-item>
            </el-menu-item-group>
          </el-sub-menu>
          <el-sub-menu index="2">
            <template #title>
              <el-icon><icon-menu /></el-icon>商品
            </template>
            <el-menu-item-group>
              <el-menu-item index="2-1">店铺商品列表</el-menu-item>
            </el-menu-item-group>
          </el-sub-menu>
          <el-sub-menu index="3">
            <template #title>
              <el-icon><icon-menu /></el-icon>订单
            </template>
            <el-menu-item-group>
              <el-menu-item index="3-1">店铺订单列表</el-menu-item>
            </el-menu-item-group>
          </el-sub-menu>
          <el-sub-menu index="4">
            <template #title>
              <el-icon><icon-menu /></el-icon>地址
            </template>
            <el-menu-item-group>
              <el-menu-item index="4-1">
                <p @click="toAddressVue()">店铺地址列表</p>
              </el-menu-item>
            </el-menu-item-group>
          </el-sub-menu>
          <el-sub-menu index="5">
            <template #title>
              <el-icon><icon-menu /></el-icon>优惠卷
            </template>
            <el-menu-item-group>
              <el-menu-item index="5-1">
                <p>优惠卷列表</p>
              </el-menu-item>
            </el-menu-item-group>
          </el-sub-menu>
          <el-sub-menu index="6">
            <template #title>
              <el-icon><icon-menu /></el-icon>评价
            </template>
            <el-menu-item-group>
              <el-menu-item index="6-1">
                <p>评价列表</p>
              </el-menu-item>
            </el-menu-item-group>
          </el-sub-menu>
        </el-menu>
      </el-scrollbar>
    </el-aside>

    <el-container>
      <el-header style="text-align: right; font-size: 12px">
        <div class="toolbar">
          <el-dropdown>
            <el-icon style="margin-right: 8px; margin-top: 1px">
              <setting />
            </el-icon>
            <template #dropdown>
              <el-dropdown-menu>
                <el-dropdown-item>View</el-dropdown-item>
                <el-dropdown-item>Add</el-dropdown-item>
                <el-dropdown-item>Delete</el-dropdown-item>
              </el-dropdown-menu>
            </template>
          </el-dropdown>
          <span>青黛店铺管理页面</span>
        </div>
      </el-header>

      <el-main>
        <router-view> </router-view>
      </el-main>
    </el-container>
  </el-container>
</template>
  
<script lang="ts" setup>
import { Menu as IconMenu, Message, Setting } from '@element-plus/icons-vue'
import { ref } from 'vue'
import { mainStore } from "../../store/index";
const store = mainStore();
import { useRouter } from 'vue-router'
const router = useRouter()

const drawer = ref(false)



const toAddressVue = () => {
  const item: any = { attribute: "edit" };
  router.push({
    path: "/SellerOperate/Address",
    query: item
  })
}

</script>
  
<style scoped lang="scss">
.layout-container-demo .el-header {
  position: relative;
  background-color: var(--el-color-success-light-7);
  color: var(--el-text-color-success);
}

.layout-container-demo .el-aside {
  background: var(--el-color-success-light-7);
  color: var(--el-text-color-success);
}

.layout-container-demo .el-menu {
  border-right: none;
}

.layout-container-demo .el-main {
  padding: 0;
}

.layout-container-demo .toolbar {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 100%;
  right: 20px;
}

.shopCartIcon {
  position: fixed;
  right: 80px;
  bottom: 80px;
  z-index: 1;

  .el-button {
    width: 120px;
    height: 40px;
  }
}
</style>
  